home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / dos / communic / pcmail / main / comport.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-05  |  3.2 KB  |  73 lines

  1. /*
  2.  * Comport.h
  3.  *
  4.  * defines the bit masking for the get_mcr()
  5.  *
  6.  * @(#) comport.h    Version hoptoad-1.3    87/03/24
  7.  *
  8.  * Copyright (C) Tim M. Pozar 1987
  9.  * Anyone can use this code for anything, but it is copyright by Tim
  10.  * and you must leave his copyright in the code.
  11.  *
  12.  */
  13.  
  14. /*
  15.  * get_msr()
  16.  *   Function to read (get) the byte located in the Modem Status 
  17.  * Register (3FEh).  The table below describes the byte returned.
  18.  *   bit  description
  19.  *    0   Delta Clear to Send (DCTS)
  20.  *        Indicates that the !CTS input to the chip has changed state
  21.  *        since the last time it was read by the processor.
  22.  *    1   Delta Data Set Ready (DDSR)
  23.  *        Indicates that the !DRS input to the chip has changed since 
  24.  *        last time it was read by the processor.
  25.  *    2   Trailing Edge Ring Indicator (TERI)
  26.  *        Indicates that the !RI input to the chip has changed from
  27.  *        an on (logical 1) to an off (logical 0) condition.
  28.  *    3   Delta Rx Line Signal detect (DRLSD)
  29.  *        Indicates that the !RLSD input to the chip has changed state.
  30.  * NOTE: Whenever bit 0, 1, 2, or 3 is set to a logical 1, a modem status
  31.  *       interrupt is generated.
  32.  *
  33.  *    4   Clear to Send (CTS)
  34.  *        This bit is the complement of the clear to send (!CTS) input.
  35.  *        If bit 4 (LOOP) of the MCR is set to a logical 1, this is 
  36.  *        equivalent to RTS in the MCR.
  37.  *    5   Data Set Ready (DSR)
  38.  *        This bit is the complement of the data set ready (!DSR) input.
  39.  *        If bit 4 (LOOP) of the MCR is set to a logical 1, this is 
  40.  *        equivalent to DTR in the MCR.
  41.  *    6   Ring Indicator (RI)
  42.  *        This bit is the complement of the ring indicator (!RI) input.
  43.  *        If bit 4 (LOOP) of the MCR is set to a logical 1, this is 
  44.  *        equivalent to OUT 1 in the MCR.
  45.  *    7   Receive Line Signal Detect (RLSD) or Carrier Detect (CD).
  46.  *        This bit is the complement of the received line signal detect
  47.  *        (!RLSD) input. If bit 4 (LOOP) of the MCR is set to a logical 1,
  48.  *        this is equivalent to OUT 2 in the MCR.
  49.  */
  50.  
  51. #define  DCTS       1
  52. #define  DDSR       2
  53. #define  TERI       4
  54. #define  DRLSD      8
  55. #define  CTS       16
  56. #define  DST       32
  57. #define  RI        64
  58. #define  RLSD     128   /* Also known as ... */
  59. #define  CD       128   
  60. #define  set_tty        SET_TTY     /* find current settings, and initialize */
  61. #define  reset_tty      RESET_TTY   /* reset to settings that set_tty() found */
  62. #define  get_msr        GET_MSR     /* get MSR byte from port. */
  63. #define  init_comm      INIT_COMM   /* initialize the comm port interupts, */
  64. #define  uninit_comm    UNINIT_COMM /* remove initialization, */
  65. #define  set_xoff       SET_XOFF    /* enable/disable XON/XOFF, */
  66. #define  get_xoff       GET_XOFF    /* read XON/XOFF state, */
  67. #define  rcvd_xoff      RCVD_XOFF   /* returns true if XOFF rcvd, */
  68. #define  sent_xoff      SENT_XOFF   /* true if XOFF sent, */
  69. #define  inp_cnt        INP_CNT     /* returns count of rcv chars, */
  70. #define  inp_char       INP_CHAR    /* get one char from buffer, */
  71. #define  inp_flush      INP_FLUSH   /* flush input buffer, */
  72. #define  outp_char      OUTP_CHAR   /* output a character, */
  73.